package com.bytezero.overload;

/**
 * 
 * @Description 
 * @author  Bytezero·zhenglei!      Email:420498246@qq.com
 * @version
 * @date 2021年9月13日下午8:04:17
 * @
 *
 */
public class ValueTransferTest3
{
	public static void main(String[] args)
	{
		Data data = new Data();
		
		data.m = 10;
		data.n = 20;
		System.out.println("m="+ data.m +",n="+data.n);
		
		
		//交换m和n的值
//		int temp = data.m;
//		data.m = data.n;
//		data.n = temp;
		
		ValueTransferTest3 test3 = new ValueTransferTest3();
		test3.swap(data);
		
		System.out.println("m="+ data.m +",n="+data.n);
		
		
	}
	
	public void swap(Data data)
	{
		//交换m和n的值
		int temp = data.m;
		data.m = data.n;
		data.n = temp;
	}
	
}

class Data
{
	int m;
	int n;
	
	
	
}



























